
import * as ActionTypes from '../../../constants/constants.js'
import * as util from '../../../util/utils.js'



// 权限
export const auth = (state = {}, action) => {
    switch (action.type) {
        case ActionTypes.auth:
            return action.data
        case ActionTypes.authError:
            state.error = action.data.error
            return {
                ...state,
                ...action.data
            }
        case ActionTypes.authReset:
            return {}
        default:
            return state;
    }
}

// 手机号编码
export const globalCodeList = (state = [], action) => {
    switch (action.type) {
        case ActionTypes.globalCodeList:
            return action.data
        case ActionTypes.globalCodeListError:
            state.error = action.data.error
            return {
                ...state,
                ...action.data
            }
        default:
            return state;
    }
}

// 商家id
export const user = (state = null, action) => {
    switch (action.type) {
        case ActionTypes.GET_USER_INFO:
            return action.data
        default:
            return state;
    }
}
export const wxUser = (state = null, action) => {
    switch (action.type) {
        case ActionTypes.GET_WX_USER_INFO:
            return action.data
        default:
            return state;
    }
}
// [RNSplashScreen show];
